package com.atguigu.exer;

/**
 * @author yihu
 * @create 2021-03-05 11:35
 * @email:1057202547@qq.com
 * @dec:
 */
public class Employe implements  Comparable{
    private String name;
    private int age;
    private MyDate birthday;

    public Employe() {
    }

    public Employe(String name, int age, MyDate birthday) {
        this.name = name;
        this.age = age;
        this.birthday = birthday;
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public void setBirthday(MyDate birthday) {
        this.birthday = birthday;
    }

    public String getName() {
        return name;
    }

    public int getAge() {
        return age;
    }

    public MyDate getBirthday() {
        return birthday;
    }

    @Override
    public String toString() {
        return "Employe{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", birthday=" + birthday +
                '}';
    }

    @Override
    public int compareTo(Object o) {
        if(o instanceof  Employe){
            Employe e = (Employe)o;
            return this.name.compareTo(e.name);
        }
        throw  new RuntimeException("传入得数据类型不一致");
    }
}
